<%= stylesheet_link_tag("contents_register") %>
      <div id="main">
      <% form_for :question, :url => {:action => 'create'} do |f| -%>

        <div class="subtitle">分類</div>
        <div class="qa_box">
          <%# category field %>
          <div class="label">カテゴリ</div>
          <div class="field">
            <%= select_tag "category",
               options_from_collection_for_select(Category.find(:all), :id, :name)
            %>
          </div>

          <%# tag field%>
          <div class="label">タグ</div>
          <div class="field">
            <%= text_field_tag "tag", "", {:size => 20} %>
            ※ 「自分で登録」タグは自動でつきます。
          </div>
        </div>
        
        <div class="qa_box">
          <div class="subtitle">問題</div>
          <div class="label">問題文</div>
          <div class="field">
            <%= text_area_tag "question_ta", "", :size => "40x5" %>
          </div>
        </div>

        <div class="qa_box">
          <div class="subtitle">解答</div>
          <div class="label">回答方法</div>
          <div class="field">
            <%= select_tag "question_type",
                options_from_collection_for_select(QuestionType.find(:all),
                :id, :name) %>
          </div>

          <%# TODO: 絶対もっとスッキリできるはず %>
          <div id="selection_box">
            <div class="label">選択肢 ※ 正解にチェックを入れてください</div>
            <div class="field">
              <ul>
                <li><div class="selection_box"><input id="is_collect[1]" name="is_collect[1]" type="checkbox" />
                <%= text_field_tag "selection[1]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[2]" name="is_collect[2]" type="checkbox" />
                <%= text_field_tag "selection[2]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[3]" name="is_collect[3]" type="checkbox" />
                <%= text_field_tag "selection[3]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[4]" name="is_collect[4]" type="checkbox" />
                <%= text_field_tag "selection[4]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[5]" name="is_collect[5]" type="checkbox" />
                <%= text_field_tag "selection[5]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[6]" name="is_collect[6]" type="checkbox" />
                <%= text_field_tag "selection[6]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[7]" name="is_collect[7]" type="checkbox" />
                <%= text_field_tag "selection[7]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[8]" name="is_collect[8]" type="checkbox" />
                <%= text_field_tag "selection[8]", "", {:size => 20} %><br /></div></li>
                <li><div class="selection_box"><input id="is_collect[9]" name="is_collect[9]" type="checkbox" />
                <%= text_field_tag "selection[9]", "", {:size => 20} %><br /></div></li>
              </ul>
            </div>
          </div>

          <div id="user_input_box">
            <div class="label">解答(入力の場合)</div>
            <div class="field">
              <%= text_area_tag "answer_ta", "", :size => "40x3" %>
            </div>
          </div>
        </div>

        <div class="qa_box">
          <div class="subtitle">解説</div>
          <div class="label">解説文</div>
          <div class="field">
            <%= text_area_tag "description_ta", "", :size => "40x5" %>
          </div>
        </div>

        <input type="submit" value="登録"/>
        <input type="reset" value="修正" />
      </div>
    <% end -%>
